package com.txh.blog.mq;

import com.txh.blog.service.ArticleService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 消息消费者
 */
@Component
public class MqRever {
    @Autowired
    private ArticleService articleService;
    @RabbitListener(queues = "topic.message")
    public void process(Long id){
        System.out.println("接受消息。。"+id);
        articleService.incrReadNumById(id);
    }
}
